const localStorage = window.localStorage
function setStorage(key, value) {
    /** localStorage存储数据
     * key   String  存储的名字
     * value    all      存储的值
     */
    try {
        if(!key) return
        localStorage.setItem(key, JSON.stringify(value))
    } catch (error) {

    }
}

function getStorage(key) {
    /** localStorage获取数据
     *  key   String  存储的名字
     */
    try {
        if (!key) return ''
        return JSON.parse(localStorage.getItem(key))
    } catch (error) {
        return ''

    }
}

export default {
    setStorage,
    getStorage
}